package com.ls.common;

/**
 * @author atom.hu
 * @version V1.0
 * @Package com.ls.common
 * @date 2021/10/14 19:11
 * 获取当前线程id
 */
public class BaseContext {
    private static ThreadLocal<Long> threadLocal = new ThreadLocal<>();
    /**
     * 设置值
     * @param id
     */
    public static void setCurrentId(Long id){
        threadLocal.set(id);
    }
    /**
     * 获取值
     * @return
     */
    public static Long getCurrentId(){
        return threadLocal.get();
    }
}
